package com.xxl.job.admin.aspect;

import com.xxl.job.admin.core.util.CookieUtil;
import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

/**
 * @author songsong
 * @version 1.0
 * @date 2022/12/29 14:21
 **/
@Aspect
@Component
public class JobInfoAspect {

    @Pointcut("execution(public * com.xxl.job.admin.service.impl.XxlJobServiceImpl.add(..)))")
    public void JobInfoAddPointcut() {
    }

    @Pointcut("execution(public * com.xxl.job.admin.service.impl.XxlJobServiceImpl.remove(..)))")
    public void JobInfoRemovePointcut() {
    }

    @AfterReturning(pointcut = "JobInfoAddPointcut()||JobInfoRemovePointcut()")
    public void afterReturning(){
        CookieUtil.flag = true;
    }
}
